﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using VISS.API.Users;

namespace VISS.Web.BackEnd {
    /// <summary>
    /// Summary description for ImageUtils
    /// </summary>
    public class ImageUtils {

        public ImageUtils() {
        }

        public static string GetDefaultAvatarPath(EUserGender gender) {
            if (gender == EUserGender.Female) {
                return AppSettings.ImagesURL + "avatar/avatar-f-large.jpg";
            }
            else {
                return AppSettings.ImagesURL + "avatar/avatar-m-large.jpg";
            }
        }

        public static string GetDefaultAvatarThumbPath(EUserGender gender) {
            if (gender == EUserGender.Female) {
                return AppSettings.ImagesURL + "avatar/avatar-f-small.jpg";
            }
            else {
                return AppSettings.ImagesURL + "avatar/avatar-m-small.jpg";
            }
        }

        public static string GetAvatarPath(string avatarFileName) {
            return AppSettings.ImageStoreUploadServer + avatarFileName;
        }

        public static string GetAvatarThumbPath(string avatarFileName) {
            int indexOfDot = avatarFileName.LastIndexOf(".");
            string avatarThumbFileName = avatarFileName.Substring(0, indexOfDot) + "-thumb" + avatarFileName.Substring(indexOfDot);
            return AppSettings.ImageStoreUploadServer + avatarThumbFileName;
        }
    }
}